/*
 * @lc app=leetcode id=492 lang=cpp
 *
 * [492] Construct the Rectangle
 */

// @lc code=start
class Solution {
public:
    vector<int> constructRectangle(int area) {
        int n = static_cast<int>(sqrt(area));
        std::vector<int> res;
        for (int w = n; w >= 1; w--) {
            int h = area % w;
            if (h == 0) {
                 res.push_back(area/w);
                 res.push_back(w);
                break;
            }
        }
        return res;
        
    }
};
// @lc code=end

